"use strict";

module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.bulkInsert(
      "role",
      [
        {
          role_name: "用户",
          role_route: "user",
          is_show: 1,
          created_at: new Date(),
          updated_at: new Date(),
        },
        {
          role_name: "已删除",
          role_route: "_delete",
          is_show: 0,
          created_at: new Date(),
          updated_at: new Date(),
        },
        {
          role_name: "超级管理员",
          role_route: "admin",
          is_show: 1,
          created_at: new Date(),
          updated_at: new Date(),
        },
        {
          role_name: "咨询师",
          role_route: "counselor",
          is_show: 1,
          created_at: new Date(),
          updated_at: new Date(),
        },
      ],
      {}
    );
  },

  down: async (queryInterface, Sequelize) => {
    // 删除所有角色记录，确保回滚时数据一致
    await queryInterface.bulkDelete("role", null, {});
  },
};
